logged users with Doors floating licenses

Hello,

hope i didn't missed something in the search!

Did some one know how i can figure out which user is logged in? (Doors 9.5 floating licenses and clients)

Thank you in advance!

 

Regards, Gelmoore.


Gelmoore - Tue Sep 09 09:21:27 EDT 2014

Re: logged users with Doors floating licenses
kensarai - Wed Sep 10 03:09:38 EDT 2014

You can use DOORS Database Server Administration Tool.

http://www-01.ibm.com/support/knowledgecenter/SSYQBZ_9.4.0.1/com.ibm.doors.administering.doc/topics/t_checkusersconnections.html?lang=en

If you would like to troubleshoot license issues, you may use License tools (LMTools) > Server Status tab. You will see the list of client machines where license is checked out for.

Re: logged users with Doors floating licenses
llandale - Wed Sep 10 13:46:58 EDT 2014

Don't know.  But I think you should clarify your question.

[1] How can I tell who is logged into my particular database?  This is a DXL issue

[2] How can I tell who has checked out various IBM token licenses?  This is a License issue.

-Louie

Re: logged users with Doors floating licenses
PDU - Tue Sep 16 02:16:23 EDT 2014

a little script

 

Pierre


Attachments

UtilisateursConnectes.dxl

Re: logged users with Doors floating licenses
llandale - Tue Sep 16 16:20:47 EDT 2014

PDU - Tue Sep 16 02:16:23 EDT 2014

a little script

 

Pierre

Running out of time.  I have learnt, the very very very hard way, to search for all instances of my Skip lists to make sure I'm using the KEY and DATA consistently.  Same for "Arrays".  Anyway, if you search for "skpUserWorking" we see you are inserting a "string username" into the DATA of the skip but retrieving a "User uNotWorking".  That is asking for trouble but since you don't actually use "uNotWorking" I think you dodged the bullet.  This time.

Something doesn'ty feel right at about 86.  If the user has something else locked then the skip "put" won't do anything, and there will be less entries in the Skip then there are in your 1stUser ListView.

I think at line #112 you want to "break" not "halt".

Re: logged users with Doors floating licenses
PDU - Wed Sep 17 01:28:54 EDT 2014

llandale - Tue Sep 16 16:20:47 EDT 2014

Running out of time.  I have learnt, the very very very hard way, to search for all instances of my Skip lists to make sure I'm using the KEY and DATA consistently.  Same for "Arrays".  Anyway, if you search for "skpUserWorking" we see you are inserting a "string username" into the DATA of the skip but retrieving a "User uNotWorking".  That is asking for trouble but since you don't actually use "uNotWorking" I think you dodged the bullet.  This time.

Something doesn'ty feel right at about 86.  If the user has something else locked then the skip "put" won't do anything, and there will be less entries in the Skip then there are in your 1stUser ListView.

I think at line #112 you want to "break" not "halt".

Thanks,

it was one of the first script à wrote ....

 

Need some corrections
 

Pierre

Re: logged users with Doors floating licenses
llandale - Wed Sep 17 16:08:41 EDT 2014

PDU - Wed Sep 17 01:28:54 EDT 2014

Thanks,

it was one of the first script à wrote ....

 

Need some corrections
 

Pierre

Well, if this is your first script...

[1] I notice you declared your DB and DBEs in the program context at the top.  That is regreattably routine except for the simplest dialogs.  The callback funcions often need to get at those variables.

[2] I notice you have lots of other variables declared in the top context.  That is NOT routine and asking for trouble.  e.g. move "string uEmail" into the only function that needs it, getList().

[3] I notice function "getList()" starts at line #49 and ends at line #160.  The only way In know that is that I have bracket matching in my editor.  You really should indent the body of functions.

[4] I never use progressStop stuff, but in this case finding locks and users doesn't take much time and this capability is a waste.  contrast that to a script that opens 300 module; which takes a very long time and perhaps should be stoppable.

[5] I see your main code starts at line 185.  I'd put a banner to that effect.

[6] For practice, put pring statements in your 3 select callbacks, e.g. infoBox( "doSelect() " i " [" (get(1stUser, i)) "]").  You may get surprised at the order the boxes are displayed and may get surprised at what value gets displayed.

[7] You should be careful using identifiers (variable names) that are the same as native functions; in this case "username".  Usually it doesn't matter but once in a while DXL gets confused; I specifically recall using variable "target" and DOORS though I wanted to call the function called "target".  I think this fact, so many years ago, compelled me to use upper case characters for all words in a variable, e.g. "UserName"; insuring there is no conflict.

[8] Need better names and more comments.  Perhaps rename variable "i" to NumRows".

[9] line 134 you are concatenating results inside a loop. 

  •   ListeUtilisateurs = ListeUtilisateurs " - " uName ""

In this case the number of locks by users is certainly manageable (say 30), but that code is a disaster if say there are 300 iterations of the loop.

  • for (i=0; i<1000; i++) a = a "x"

If I did my math correctly you end up with a string of 1000 "x"s, but waste 500,000 bytes in the string table; strings "x", "xx", "xxx", ...  Far better is the following which you should start practicing with now.

  • Buffer bufResults = create()
  • for my loop
  • {  bufResults += results of this loop
  • }
  • string Results = stringOf(bufResults)
  • delete(bufResults)

[] Line 157, I'd be tempted to dump results into some large "text" DBE on the dialog.  In any event, in years past infoBoxes dont like a lot of EOLs.

[] I don't read Swaheelie, or whatever, but I think you are trying to distinquish between folks with DOORS open with a locked folder (which is inconsequential) and those who left a module locked.  The following isn't really "better" but it does show how to use the "Data" of a skip list.

  • for lockItem..
  • {  put(skpUser, username, false)   // put only if username not already in the Skip.
  •    if this is a locked Formal
       {  delete(skpUser, username)   // Remove user name from skip, if already there
  •       put(skpUser, username, true)   // make sure this user has a "formal" flag
  •    }
  • }
  • bool ModFlag
  • for ModFlag in skpUsers do
  • {  username = (string key skpUsers)
  •    if (ModFlag) //
  •    then user has some module locked
  •    else user has some folder only locked.
  • }

In fact, I'd probably use an "int" data, insert a zero, and increment it for each locked module. Then display how many locked modules each user has.

-Louie

Re: logged users with Doors floating licenses
kourosh - Thu Sep 18 12:36:01 EDT 2014

The actual license.log which you can also find in LMTOOLS will show you which username@hostname has a certain feature checked out.

Re: logged users with Doors floating licenses
PDU - Wed Sep 24 02:18:49 EDT 2014

llandale - Wed Sep 17 16:08:41 EDT 2014

Well, if this is your first script...

[1] I notice you declared your DB and DBEs in the program context at the top.  That is regreattably routine except for the simplest dialogs.  The callback funcions often need to get at those variables.

[2] I notice you have lots of other variables declared in the top context.  That is NOT routine and asking for trouble.  e.g. move "string uEmail" into the only function that needs it, getList().

[3] I notice function "getList()" starts at line #49 and ends at line #160.  The only way In know that is that I have bracket matching in my editor.  You really should indent the body of functions.

[4] I never use progressStop stuff, but in this case finding locks and users doesn't take much time and this capability is a waste.  contrast that to a script that opens 300 module; which takes a very long time and perhaps should be stoppable.

[5] I see your main code starts at line 185.  I'd put a banner to that effect.

[6] For practice, put pring statements in your 3 select callbacks, e.g. infoBox( "doSelect() " i " [" (get(1stUser, i)) "]").  You may get surprised at the order the boxes are displayed and may get surprised at what value gets displayed.

[7] You should be careful using identifiers (variable names) that are the same as native functions; in this case "username".  Usually it doesn't matter but once in a while DXL gets confused; I specifically recall using variable "target" and DOORS though I wanted to call the function called "target".  I think this fact, so many years ago, compelled me to use upper case characters for all words in a variable, e.g. "UserName"; insuring there is no conflict.

[8] Need better names and more comments.  Perhaps rename variable "i" to NumRows".

[9] line 134 you are concatenating results inside a loop. 

  •   ListeUtilisateurs = ListeUtilisateurs " - " uName ""

In this case the number of locks by users is certainly manageable (say 30), but that code is a disaster if say there are 300 iterations of the loop.

  • for (i=0; i<1000; i++) a = a "x"

If I did my math correctly you end up with a string of 1000 "x"s, but waste 500,000 bytes in the string table; strings "x", "xx", "xxx", ...  Far better is the following which you should start practicing with now.

  • Buffer bufResults = create()
  • for my loop
  • {  bufResults += results of this loop
  • }
  • string Results = stringOf(bufResults)
  • delete(bufResults)

[] Line 157, I'd be tempted to dump results into some large "text" DBE on the dialog.  In any event, in years past infoBoxes dont like a lot of EOLs.

[] I don't read Swaheelie, or whatever, but I think you are trying to distinquish between folks with DOORS open with a locked folder (which is inconsequential) and those who left a module locked.  The following isn't really "better" but it does show how to use the "Data" of a skip list.

  • for lockItem..
  • {  put(skpUser, username, false)   // put only if username not already in the Skip.
  •    if this is a locked Formal
       {  delete(skpUser, username)   // Remove user name from skip, if already there
  •       put(skpUser, username, true)   // make sure this user has a "formal" flag
  •    }
  • }
  • bool ModFlag
  • for ModFlag in skpUsers do
  • {  username = (string key skpUsers)
  •    if (ModFlag) //
  •    then user has some module locked
  •    else user has some folder only locked.
  • }

In fact, I'd probably use an "int" data, insert a zero, and increment it for each locked module. Then display how many locked modules each user has.

-Louie

Thanks very much :-)

 

Pierre